<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="区域订单监控" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="意向单号"
                            ng-model="condition.saleNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()" date-picker="true" hide-date="switchDatePicker()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">意向单号：</label>
                        <textarea ng-model="condition.billNos" class="form-control" placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购单号：</label>
                        <input type="text" ng-model="condition.purchaseNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">创建人：</label>
                        <input type="text" ng-model="condition.createName" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" ng-model="condition.purchaseOrgName" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <textarea ng-model="condition.purchaseNames" class="form-control"
                            placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">零件编号：</label>
                        <textarea ng-model="condition.materialsNo" class="form-control" placeholder="逗号分隔或者换行分隔">
                        </textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">CRM单号：</label>
                        <input type="text" ng-model="condition.crmOrder" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">前移单号：</label>
                        <input type="text" ng-model="condition.pmsCode" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">出库状态：</label>
                        <select class="form-control" ng-model="condition.inventoryOutStatus"
                            ng-options="item.id as item.name for item in deliverStatusList" required yb-focus>
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购级别：</label>
                        <select class="form-control" ng-model="condition.purchaseLevelId"
                            ng-options="item.code as item.name for item in purchaseLevelList" required yb-focus>
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label">制单时间：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateStart"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(0)"
                            is-open="datePickerFlag[0]" close-text="关闭"
                            ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateEnd"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(1)"
                            is-open="datePickerFlag[1]" close-text="关闭"
                            ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">无价格：</label>
                        <select class="form-control" ng-model="condition.isSynPrice">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="sellTbConf" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
                <div class="main-area">
                    <div yb-table-fixed class="table-fixed-wrap">
                        <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                            <table class="table-fixed border-none" width="{{sellTbConf.scrollWidth}}">
                                <thead>
                                <tr>
                                    <th ng-repeat="itemCol in sellTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(sellTbConf.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="sellTbConf.scrollWidth"></div>
                                    </th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                            <table class="table-fixed border-none" width="{{sellTbConf.scrollWidth}}">
                                <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curRow}" ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in sellTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                    </div>
                </div>
        </div>

        <!-- 查看、审核 -->
        <div tab heading="{{tabFlag.name}}" active="activeFlag[4]" ng-if="activeFlag[4]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm" ng-repeat="item in detailMap track by $index"
                    ng-if="item.isShow">
                    <label class="col-xs-4 m-b-n text-right max-w-100" ng-if="item.name != '是否前移'">{{item.name}}：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" ng-if="item.name != '是否前移'"
                        title="{{orderObj.headerInfo[item.field] !== null ? orderObj.headerInfo[item.field] : '-'}}">
                        {{orderObj.headerInfo[item.field] !== null ? orderObj.headerInfo[item.field] : '-'}}
                    </div>
                    <label class="col-xs-4 m-b-n text-right max-w-100" ng-if="item.name == '是否前移'">{{item.name}}：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" ng-if="item.name == '是否前移'"
                        title="{{orderObj.headerInfo[item.field] !== null ? orderObj.headerInfo[item.field] : '-'}}">
                        {{orderObj.headerInfo[item.field]  | TrueOrFalse}}
                    </div>
                </div>
            </div>
            <div tabset type="sub-tab">
                <div tab heading="零件信息" active="subTabFlag[0]">
                    <div class="main-area d-b-60" ng-style="{'top':isTJ?'270px':'245px'}">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="{{viewTbConf.scrollWidth}}">
                                    <thead>
                                        <tr>
                                            <th ng-repeat="itemCol in viewTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                                <div yb-thead-operate ng-model="itemCol"
                                                    target-width="viewTbConf.scrollWidth"></div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                                <table class="table-fixed border-none" width="{{viewTbConf.scrollWidth}}">
                                    <tbody>
                                        <tr ng-repeat="item in orderObj.materialList track by $index">
                                            <td class="spill-dots"
                                                ng-repeat="itemCol in viewTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                                ng-if="!itemCol.hidden">
                                                <span ng-if="!!itemCol.clickFnDaChang">
                                                    {{sapStockMap[item.materialsNo].totalStock}}
                                                </span>
                                                <span ng-else>
                                                    {{item[itemCol.dataField]}}
                                                </span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="no-data w-full text-center p-t" ng-show="dataList.materialList.length === 0">
                                暂时没有数据
                            </div>
                        </div>
                    </div>
                </div>
                <div tab heading="发货通知" active="subTabFlag[1]" ng-click="getDeliveryNotice()">
                    <div class="main-area d-b-60" ng-style="{'top':isTJ?'270px':'245px'}">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="{{deliveryTbConf.scrollWidth}}">
                                    <thead>
                                        <tr>
                                            <th ng-repeat="itemCol in deliveryTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}">
                                                <div yb-thead-operate ng-model="itemCol"
                                                    target-width="viewTbConf.scrollWidth"></div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll" ng-show="deliveryList.length > 0">
                                <table class="table-fixed border-none" width="{{deliveryTbConf.scrollWidth}}">
                                    <tbody>
                                        <tr ng-repeat="item in deliveryList track by $index">
                                            <td class="spill-dots"
                                                ng-repeat="itemCol in deliveryTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}">
                                                {{item[itemCol.dataField]}}
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="no-data w-full text-center p-t" ng-show="deliveryList.length === 0">暂时没有数据</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <span>
                    <button type="button" class="btn btn-default m-r-sm" ng-click="changeTab(0)">返回</button>
                </span>
            </div>
        </div>


    </div>
</div>